<?php
	/*
		PandaForum: PHP Forum Engine
		
		Jesse Gill, 0108377707
	*/
	
	require_once('./src/classes/Page.php');
	
	$page = new Page('ACP-Forums');
	
	$page->print_header();
	
	// Only admins can access the admin control panel
	if (! $page->curUser->has_rank("Admin", $page->connection))
		die('You must be an admin to access this page.');
?>
	<link href='src/css/acp.css' rel='stylesheet' type='text/css' />
	<link href='src/css/acp-forums.css' rel='stylesheet' type='text/css' />
	<script type="text/javascript" src="src/js/ajax_functions_acp.js"></script>
	
	<script type="text/javascript">
		acp_forums_refreshlist();
	</script>
	
	<h1 class="pageheading">Edit Forums</h1>
	
	<div id="forumlist"> </div>
	
	<form id="addcategory" name='addCategory' method='post' action='javascript:ajax_addcategory(document.addCategory.name.value);'>
		<h3>Add Category</h3><br />
		Name: <input type='text' name='name' /><br /><br />
		<input type="submit" value="Create" /><br /><br />
	</form>
	
	<form id="addforum" name='addForum' method='post' action='javascript:ajax_addforum(document.addForum.name.value, document.addForum.category.value);'>
		<h3>Add Forum</h3><br />
		Name: <input type='text' name='name' />
		Category: <input type='text' name='category' /><br /><br />
		<input type="submit" value="Create" /><br /><br />
		<div id="results"></div>
	</form>
<?php
	$page->print_acp_nav();
	$page->print_footer();
?>